<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>
<style>
    .layui-input-inline {
        width: 400px !important;
    }
</style>

<div class="layui-fluid" id="app">
    <div class="layui-row layui-col-space15" style="margin-top: 10%">
        <div class="layui-col-md12">
                    <form class="layui-form " action="">
                        <div class="layui-form-item" style="margin-bottom: 20%">

                                <label class="layui-form-label">工价</label>
                                <div class="layui-input-block" style="width: 55%">
                                    <input type="text" name="price" value="{$price.pricet}" class="layui-input" >
                                </div>

                        </div>
                        <div class="layui-form-item">
                                <div style="text-align: center;width: 100%">
                                    <button class="layui-btn" lay-submit lay-filter="add_price">确定</button>
                                </div>
                        </div>

                    </form>
        </div>

    </div>

</div>
</div>
<script>
    layui.use('form', function () {
        var $ = layui.$
            , layer = layui.layer
            , form = layui.form;
        form.on('submit(add_price)', function (obj) {
            $.post("{:url('worker_price')}", {price:obj.field.price,yid:"{$Request.param.yid}",wid:"{$Request.param.wid}"}, function (res) {
                if (res.code == 1) {
                     parent.layer.closeAll();
                    parent.layer.msg(res.msg, {icon: 1})
                    $('.layui-form')[0].reset();
                    parent.init();
                    return false;
                } else {
                    parent.layer.msg(res.msg, {icon: 2})
                    return false;
                }

            });
            return false;
        });
    });
</script>
</body>
</html>